const myResumeModel = require('../modules/myResume')

class myResumeController {
  // 增加留言
  static async createLeaveMessage(ctx) {
    const data = ctx.request.body
    console.log('ctx', ctx)
    myResumeModel.createLeaveMessage(data.content)
    ctx.response.status = 200;
    ctx.body = {
      result: '000000',
      msg: 'ok',
    }
  }

  // 查找内容
  static async findAllMessage(ctx) {
    try {
      console.log('Jinlaile')
      const ret = await myResumeModel.findAllMessage()
      console.log('ret', ret)
      ctx.response.status = 200;
      ctx.body = {
        result: '000000',
        msg: 'ok',
        data: ret,
      }
    } catch (err) {
      console.log('err', err)
    }
  }
}

module.exports = myResumeController
